import service from '@/utils/request'

// 查询云分析列表
export const getCloudAnalysisListRequest = data => {
  return service({
    method: 'post',
    url: '/cloudAnalysis/getCloudAnalysisList',
    data
  })
}

// 新增目录
export const addDirectoryRequest = data => {
  return service({
    method: 'post',
    url: '/cloudAnalysis/addDirectory',
    data
  })
}

// 修改目录
export const modifyDirectoryRequest = data => {
  return service({
    method: 'post',
    url: '/cloudAnalysis/modifyDirectory',
    data
  })
}

// 删除目录
export const deleteDirectoryRequest = data => {
  return service({
    method: 'post',
    url: '/cloudAnalysis/deleteDirectory',
    data
  })
}

// 新增菜单
export const addMenuRequest = data => {
  return service({
    method: 'post',
    url: '/cloudAnalysis/addMenu',
    data
  })
}

// 修改菜单
export const modifyMenuRequest = data => {
  return service({
    method: 'post',
    url: '/cloudAnalysis/modifyMenu',
    data
  })
}

// 删除菜单
export const deleteMenuRequest = data => {
  return service({
    method: 'post',
    url: '/cloudAnalysis/deleteMenu',
    data
  })
}


// 分页查询云分析项目列表
export const pageCloudAnalysisProjectRequest = data => {
  return service({
    method: 'post',
    url: '/cloudAnalysisProject/pageCloudAnalysisProject',
    data
  })
}

// 新增云分析项目
export const addCloudAnalysisProjectRequest = data => {
  return service({
    method: 'post',
    url: '/cloudAnalysisProject/addCloudAnalysisProject',
    data
  })
}

// 修改云分析项目
export const modifyCloudAnalysisProjectRequest = data => {
  return service({
    method: 'post',
    url: `/cloudAnalysisProject/modifyCloudAnalysisProject`,
    data
  })
}

// 删除云分析项目
export const deleteCloudAnalysisProjectRequest = cloudAnalysisProjectId => {
  return service({
    method: 'post',
    url: `/cloudAnalysisProject/deleteCloudAnalysisProject/${cloudAnalysisProjectId}`,
  })
}

// 查询可选择的产品下拉框
export const getProductSelectRequest = data => {
  return service({
    method: 'post',
    url: '/cloudAnalysisProject/getProductSelect',
    data
  })
}

// 查询可选择的服务器下拉框
export const getServerSelectRequest = data => {
  return service({
    method: 'post',
    url: '/cloudAnalysisProject/getServerSelect',
    data
  })
}

// 查询可选择的用户下拉框
export const getUserSelectRequest = data => {
  return service({
    method: 'post',
    url: '/cloudAnalysisProject/getUserSelect',
    data
  })
}

// 新增云分析产品
export const addCloudAnalysisProductRequest = data => {
  return service({
    method: 'post',
    url: '/cloudAnalysisProduct/addCloudAnalysisProduct',
    data
  })
}

// 删除云分析产品
export const deleteCloudAnalysisProductRequest = cloudAnalysisProductId => {
  return service({
    method: 'post',
    url: `/cloudAnalysisProduct/deleteCloudAnalysisProduct/${cloudAnalysisProductId}`,
  })
}

// 修改云分析产品
export const modifyCloudAnalysisProductRequest = data => {
  return service({
    method: 'post',
    url: `/cloudAnalysisProduct/modifyCloudAnalysisProduct`,
    data
  })
}

// 修改云分析产品
export const savePageConfigRequest = data => {
  return service({
    method: 'post',
    url: `/cloudAnalysis/savePageConfig`,
    data
  })
}

// 获取页面配置
export const getPageConfigRequest = data => {
  return service({
    method: 'post',
    url: `/cloudAnalysis/getPageConfig`,
    data
  })
}

// 上传云分析图表说明
export const uploadAnalysisDescriptionRequest = (pageCode, data) => {
  return service({
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    url: `/cloudAnalysis/uploadAnalysisDescription/${pageCode}`,
    data,
  })
}

// 删除云分析图表说明
export const deleteAnalysisChartDescriptionRequest = data => {
  return service({
    method: 'post',
    url: `/cloudAnalysis/deleteAnalysisChartDescription`,
    data
  })
}

// 上传云分析脚本文件
export const uploadAnalysisScriptFileRequest = (pageCode, data) => {
  return service({
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    url: `/cloudAnalysis/uploadAnalysisScriptFile/${pageCode}`,
    data,
  })
}

// 删除云分析脚本文件
export const deleteAnalysisScriptFileRequest = data => {
  return service({
    method: 'post',
    url: `/cloudAnalysis/deleteAnalysisScriptFile`,
    data
  })
}

// 上传云分析脚本文件
export const uploadAnalysisSpecificationRequest = (pageCode, data) => {
  return service({
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    url: `/cloudAnalysis/uploadAnalysisSpecification/${pageCode}`,
    data,
  })
}

// 删除云分析说明书
export const deleteAnalysisSpecificationRequest = data => {
  return service({
    method: 'post',
    url: `/cloudAnalysis/deleteAnalysisSpecification`,
    data
  })
}

// 查看云分析脚本内容
export const viewAnalysisScriptContentRequest = data => {
  return service({
    method: 'post',
    url: `/cloudAnalysis/viewAnalysisScriptContent`,
    data
  })
}

// 加载页面内容
export const loadPageContentRequest = data => {
  return service({
    method: 'post',
    url: `/cloudAnalysis/loadPageContent`,
    data
  })
}

// 下载云分析脚本
export const downloadAnalysisScriptRequest = data => {
  return service({
    method: 'post',
    url: `/cloudAnalysis/downloadAnalysisScript`,
    data
  })
}